package client.comm.baoding.dialog

import android.content.Context
import androidx.databinding.ObservableField
import client.comm.baoding.R
import client.comm.baoding.databinding.LayoutJyinputnumBinding
import client.tzstore.oo.dialog.CenterDialog

open class JyInputNumDialog(context: Context, val type: Int = 0) : CenterDialog<LayoutJyinputnumBinding>(context) {

    var okTxt: String = "确定"
    var cancleTxt: String = "取消"
    var cancle: (() -> Unit)? = null
    var ok: ((num: String) -> Unit)? = null

    val num = ObservableField<String>("")
    val titleTxt = ObservableField<String>("")

    fun okClick() {
        ok?.invoke(num.get()!!)
    }

    fun cancleClick() {
        cancle?.apply {
            this()
        }
        cancel()
    }

    override fun getV(): Int {
        return R.layout.layout_jyinputnum
    }

    override fun postBinding() {
        binding.event = this
    }
}